Nhảy tới nội dung

Liveness Check v3

Input image requirement

For video

  • The input video does not exceed 10MB
  • The video has at least 25fps and the minimum resolution of 720p (HD) to ensure accuracy
  • There must be only 1 face in video
  • The face area must take up at least 30% the total video frame
  • The face must not out of frame during video
  • The face must not contain spotlight or be covered or in backlit condition or out of focus
  • The video must have frontal face
  • The video is 5-6 seconds long.

For attached image (to compare the face)

  • The image to be compared with video does not exceed 5MB and has the minimum resolution of 800x600.

  • The face area must take up at least 40% the total image

Standard image

alt text

Poor-quality image/video

  • Image with low quality or covered face
  • Video is blurry, made with low-quality camera

API Information

Request Url

POST https://api.fpt.ai/vision/ekyc/liveness

Request Headers

ParameterRequiredDefaultDescription
api_keyYesyour api_key (from console.fpt.ai)

Request Body

FormData containing the video and image to be checked

ParameterRequiredValueDescription
videoYespath-to-video.mp4Video of customer’s face naturally moving
cmndNopath-to-id.pngImage to be compared with the straightest face in video

Sample Request

curl --location --request POST 'https://api.fpt.ai/vision/ekyc/liveness' \
--header 'api-key: xxxxxxxx' \
--form 'video=@"/video.mp4"' \
--form 'cmnd=@"/face.jpg"'

Response

JSON

{
"code": "200",
"message": "request successful",
"liveness": {
"code": "200",
"message": "liveness check successful",
"is_live": "true",
"spoof_prob": "0.0015",
"need_to_review": "false",
"is_deepfake": "false",
"deepfake_prob": "0.0",
"warning": "Resolution of video is too low. Please upload video with at least HD resolution to ensure accuracy"
},
"face_match": {
"code": "200",
"message": "face matching successful",
"isMatch": "false",
"similarity": "18.45",
"warning": "N/A"
}
}

Returned Information

FieldsDescription
codeCode/Error
is_liveLiveness detection result. True if prob < 0.5, otherwise False
spoof_probProbability of spoof
is_deepfakeDeepfake detection result (deepfake result is returned incase low resolution input). True if deepfake_prob >= 0.5, otherwise False
deepfake_probProbability of deepfake
face_matchFace matching result
warningWarning when input quality may harm the accuracy

Code

CodeMeaning
200No error, see more results in the above fields
301Face in video is spoof
302Video seems like deepfake
303Face is not matching with document
406Face quality is not good enough (covered, too dark/bright..)
408More than 1 face in the video
409No video uploaded/Wrong extension/Video is too short/Invalid input
410No face/Lost face in the video
411The face is too small
412The face is too blurry
413Video is still image
422No frontal face in video
423Face is out of frame during video

Sample Response: Success

{
"code": "200",
"message": "request successful",
"liveness": {
"code": "200",
"message": "liveness check successful",
"is_live": "true",
"spoof_prob": "0.3587",
"need_to_review": "false",
"is_deepfake": "N/A",
"deepfake_prob": "N/A",
"warning": ""
},
"face_match": {
"code": "200",
"message": "face matching successful",
"isMatch": "true",
"similarity": "99.97",
"warning": "N/A"
}
}

Sample Response: Error

{
    "code": "303",
    "message": "face is not matching with document",
    "liveness": {
        "code": "200",
        "message": "liveness check successful",
        "is_live": "true",
        "spoof_prob": "0.3433",
        "need_to_review": "false",
        "is_deepfake": "N/A",
        "deepfake_prob": "N/A",
        "warning": ""
    },
    "face_match": {
        "code": "303",
        "message": "face is not matching with document",
        "isMatch": "false",
        "similarity": "0.7",
        "warning": "N/A"
    }
}
{
"code": "407",
"message": "No faces detected in document",
"liveness": {
"code": "200",
"message": "liveness request successful",
"is_live": "true",
"spoof_prob": "0.3805",
"need_to_review": "false",
"is_deepfake": "N/A",
"deepfake_prob": "N/A",
"warning": ""
},
"face_match": {
"code": "407",
"message": "No faces detected in document",
"isMatch": "N/A",
"similarity": "N/A",
"warning": "N/A"
}
}

{
"code": "413",
"message": "Video may seem like image",
"liveness": {
"code": "413",
"message": "Video may seem like image",
"is_live": "false",
"spoof_prob": "N/A",
"need_to_review": "false",
"is_deepfake": "N/A",
"deepfake_prob": "N/A",
"warning": ""
},
"face_match": {
"code": "N/A",
"message": "N/A",
"isMatch": "N/A",
"similarity": "N/A",
"warning": "N/A"
}
}

{
"code": "409",
"message": "Invalid upload image",
"liveness": {
"code": "409",
"message": "Invalid upload image",
"is_live": "N/A",
"spoof_prob": "N/A",
"need_to_review": "N/A",
"is_deepfake": "N/A",
"deepfake_prob": "N/A",
"warning": "N/A"
},
"face_match": {
"code": "409",
"message": "Invalid upload image",
"isMatch": "N/A",
"similarity": "N/A",
"warning": "N/A"
}
}

Format response like liveness version 2

Response of liveness version 3 is different from liveness version 2. In order to format response like version 2, add parameter URL v2_format=1.

https://api.fpt.ai/vision/ekyc/liveness?v2_format=1

More information about liveness version 2 check this site